//
//  YYJLGraphicListDetailController.m
//  YuanyangJinlou
//
//  Created by mac004 on 2017/1/12.
//  Copyright © 2017年 suli19910309@qq.com. All rights reserved.
//  视频列表详情

#import "YYJLVideoListDetailController.h"
#import "YYJLCurriculum1Cell.h"
#import "YYJLVideoDetailController.h"
@interface YYJLVideoListDetailController ()<UICollectionViewDataSource,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout,YYJLCurriculum1Celldelegate>{
    UICollectionView* _collectionView;
}

@end

@implementation YYJLVideoListDetailController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self onCreateUI];
}
-(void)onCreateUI{
    
    UICollectionViewFlowLayout*layout=[[UICollectionViewFlowLayout alloc]init];
    
    _collectionView=[[UICollectionView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-44*PER_HEIGHT-64) collectionViewLayout:layout];
    
    _collectionView.delegate=self;
    _collectionView.dataSource=self;
    _collectionView.backgroundColor=[UIColor clearColor];
    [self.view addSubview:_collectionView];
    
    [_collectionView registerClass:[YYJLCurriculum1Cell class] forCellWithReuseIdentifier:@"cell"];
 }
#pragma mark--collectionView
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
   
        YYJLVideoDetailController * detail =[[YYJLVideoDetailController alloc]init];
        [self.navigationController pushViewController:detail animated:YES];
    
    
}
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
    return CGSizeMake(171*PER_WIDTH, 242.5*PER_HEIGHT);
}
-(UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section{
    return UIEdgeInsetsMake(10*PER_HEIGHT, 11*PER_WIDTH, 10*PER_WIDTH, 11*PER_HEIGHT);
}

-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
    return 8;
}
-(UICollectionViewCell*)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
    YYJLCurriculum1Cell*cell=[collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
    cell.backgroundColor=[UIColor whiteColor];
    cell.delegate=self;
    
        cell.isVieo=NO;
        
    return cell;
    
}

#pragma mark--播放按钮
-(void)playVideo:(NSInteger)num{
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
